package design_mode.工厂模式.运算方法;

public class DivisionMethod extends AbstractOperation {
    // 除法
    @Override
    public double getResult(double numberA, double numberB) {
        double result;
        if (numberB == 0) {
            System.out.println("除数不能为0");
            throw new ArithmeticException();
        } else {
            result = numberA / numberB;
        }
        return result;
    }
}
